package com.huike.game.dao;

import android.content.Context;

import com.huike.game.DbHelper.DataHelper;
import com.huike.game.base.Game11;
import com.j256.ormlite.dao.Dao;

import java.sql.SQLException;
import java.util.List;

public class EnvironmentDao {

    private DataHelper dataHelper;
    private Dao dao ;

    public EnvironmentDao(Context context) throws SQLException {
        dataHelper  = DataHelper.getInstance(context);
         dao = dataHelper.getDao(Game11.DataBean.class);
    }


    public void save(Game11.DataBean dataBean){
        try {
            dao.create(dataBean);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public List<Game11.DataBean> query(){
        try {
         return   dao.queryForAll();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }
}
